package cn.wbnull.springbootdemo.service.serviceImple;

import cn.wbnull.springbootdemo.enity.Food;
import cn.wbnull.springbootdemo.service.FoodID;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/*
 * @Author:大力王
 * @Date:2025/6/28-28-16:26
 * 开始了
 */
@Service
public class FoodIDImple implements FoodID {
    @Resource
    public Food foodGet;
    @Override
    public Food coordinate(double x, double y) {
        foodGet.setX(x);
        foodGet.setY(y);
        foodGet.setId("food_" + System.currentTimeMillis() + "_" + Math.random());
        foodGet.setSpawnTime(System.currentTimeMillis());
        return foodGet;
    }
}
